<template>
  <Table border :columns="columns1" :data="data1">
    <template slot-scope="{ row, index }" slot="action">
      <Button type="error" size="small" @click="remove(index)">清除</Button>
    </template>
  </Table>
</template>
<script>
export default {
  props: {
    datas: Array,
  },
  data() {
    return {
      columns1: [
        {
          title: "出库单",
          key: "did",
          align:"center"
        },
        // {
        //   title: "仓库号",
        //   key: "sid",
        // },
        {
          title: "作物名",
          key: "cid",
          align:"center"
        },
        // {
        //   title: "批号",
        //   key: "batch",
        // },
        {
          title: "操作员",
          key: "staff",
          align:"center"
        },
        {
          title: "出库数量",
          key: "num",
          align:"center"
        },
        {
          title: "日期",
          key: "date",
          align:"center"
        },
        {
          title:"备注",
          key:'desc',
          align:"center"
        },
        {
          title: "操作",
          slot: "action",
          align: 'center'
        },
      ],
      data1: this.datas,
    };
  },
  methods:{
    remove(index){
      this.$emit('removeone',index)
    }
  },
  watch:{
    datas:{
      handler(nd){
        this.data1=nd
      },
      deep:true
    }
  }
};
</script>
